import 'dart:convert';

import 'package:enterprise_v6_app/generated/json/base/json_field.dart';
import 'package:enterprise_v6_app/generated/json/double_control_entity.g.dart';


@JsonSerializable()
class DoubleControlEntity {
  DoubleControlEntity({
    this.id,
    this.name,
    this.level,
  });

  factory DoubleControlEntity.fromJson(Map<String, dynamic> json) => $DoubleControlEntityFromJson(json);
	int? level;
	String? name;
	String? id;
	List<DoubleControlChildren>? children;
	/// 是否选中
	@JSONField(deserialize: false)
	bool isChecked = false;

	Map<String, dynamic> toJson() => $DoubleControlEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class DoubleControlChildren {

	DoubleControlChildren();

	factory DoubleControlChildren.fromJson(Map<String, dynamic> json) => $DoubleControlChildrenFromJson(json);
	String? id;
	String? name;
	List<DoubleControlChildren>? children;
	/// 对象当前层级
	int? level;
	/// 任务数量
	int? taskCount;
	/// 父级id
	String? parentId;
	/// 初始风险等级：1_重大2_较大3_一般4_低
	String? initialRiskLevel;
	/// 当前风险等级：1_重大2_较大3_一般4_低
	String? currentRiskLevel;
	/// 管控手段
	@JSONField(name: 'control_measures')
	String? controlMeasures;
	/// 责任部门
	String? hazardDep;
	/// 责任人
	String? hazardLiablePerson;
	/// 是否选中
  bool isChecked = false;
	///管控手段
	String?  dataSrc;
	///责任部门ID
	String?  hazardDepId;
	///责任人ID
	String?  hazardLiablePersonId;
	///辨识人ID
	String?  hazardDistinguishPersonId;
  ///辨识人名字
	String?  hazardDistinguishPerson;
  ///辨识部门
	String?  hazardDistinguishDep;


	Map<String, dynamic> toJson() => $DoubleControlChildrenToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}
